package com.liuguilin.contentprovidersampler;

/*
 *  项目名：  ContentProviderSampler 
 *  包名：    com.liuguilin.contentprovidersampler
 *  文件名:   SecurityCenterImpl
 *  创建者:   LGL
 *  创建时间:  2016/10/22 17:50
 *  描述：    TODO
 */

import android.os.RemoteException;

public class SecurityCenterImpl extends ISecurityCenter.Stub{

    private static  final  char SECRET_CODE = '^';

    @Override
    public String encrypt(String content) throws RemoteException {
        char [] chars = content.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            chars[i] ^= SECRET_CODE;
        }
        return new String(chars);
    }

    @Override
    public String decrypt(String password) throws RemoteException {
        return encrypt(password);
    }
}
